<admintpl file="header" />
<link href="__TMPL__Public/assets/css/infomation.css" rel="stylesheet" />
</head>
<body>
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li><a href="{:U('ServiceReview/index')}">服务款审批报审表管理</a></li>
            <if condition="($Role eq 2) AND ($userrole['role'] eq 5)">
            <li><a href="{:U('ServiceReview/add')}">新增新增服务款审批报审</a></li>
            </if>
            <li class="active"><a href="{:U('ServiceReview/view', array('id'=>I('request.id/s','')))}">查看新增服务款审批报审</a></li>
        </ul>
        <section class="tab-pane active fade in" id="access">
            <div class="row">
                <div class="col-xs-12 col-md-12 col-lg-12">
                    <div class="panel panel-info">
                        <div class="panel-body">
                            <form method="post" class="form-horizontal " action="{:U('ServiceReview/audit_post')}">
                                <input type="hidden" name="report_type" value="2" >
                                <input type="hidden" name="audit_level" value="2" >
                                <input type="hidden" name="table_id" value="{$result.id}" />
                                <input type="hidden" name="audit_level" value="{$result.audit_level}" />
                                <div class="row tg-header">
                                    <div class="col-md-12 text-center">
                                        <h3>服务类进度款支付报审表</h3>
                                        <hr />
                                    </div>
                                    <div class="col-md-12">
                                        <p class="tg-to"><label>工程名称:</label><input type="text" class="input-xt input-deptname" value="{$job_name}" readonly/></p>
                                        <p class="pull-right tg-serialnum"><label>编号:</label><input class="input-xt" name="code" value="{$result.code}" required/></p>
                                    </div>
                                </div>

                                <table class="table table-bordered">
                                    <tr>
                                        <td style="border-right:none !important;">
                                            <p>
                                                <label>致：<input type="text" class="input-xt input-deptname"  name="supervisory_department" value="{$result.supervisory_department}"/>（项目监理、代建、建设机构）:</label>
                                            </p>
                                            <p class="indent20">
                                                我方已完成<input type="text" class="input-xt input-longname" name="job_content" value="{$result.job_content}" required/>工作，该本次费用为：<input type="text" class="input-xt input-yuan" name="list_pricing" value="{$result.list_pricing}" required/>元。按合同约定，扣除预付款的<input type="text" class="input-xt input-num" name="deducts_prepayment_percent" value="{$result.deducts_prepayment_percent}" required/>%为<input type="text" class="input-xt input-yuan" name="deducts_prepayment" value="{$result.deducts_prepayment}" required/>，建设单位应支付该进度款<input type="text" class="input-xt input-yuan" name="payables" value="{$result.payables}" required/>元（大写）<input type="text" class="input-xt input-deptname" name="amount_in_words" value="{$result.amount_in_words}" required/>，现将有关资料报上，请予以审核。
                                            </p>
                                            <p></p>
                                            <p>
                                                <div>
                                                    <label class="control-label">附件：</label>
                                                    <foreach name="results" item="vo">
                                                        <div class='controls' style='margin-top:10px;margin-left:20px'>
                                                            <a target="_blank" href="/{$vo.file_path}" data-type="{$vo.file_type}" path="{$vo.file_path}" name="{$vo.file_name}" class="fileDownload" ><label>{$vo.file_name}</label></a>
                                                        </div>
                                                    </foreach>
                                                </div>                                               
                                            </p>
                                            <div class="signature">
                                                <p>
                                                    服务单位（盖章）
                                                </p>
                                                <p>
                                                    项目经理（签字)
                                                </p>
                                            </div>
                                            <p class="signature-date">
                                                {$result.publish_time|substr=0,4}&nbsp;年&nbsp;{$result.publish_time|substr=5,2}月&nbsp;{$result.publish_time|substr=8,2}日
                                            </p>      
                                        </td>
                                    </tr>
                                    </tr>
                                    <if condition="($audit[3] OR $isAudit eq '2') AND $result['audit_level'] egt 3">
                                    <tr>
                                        <td colspan="4">
                                            监理单位审核意见:
                                            <p class="indent20"> 
                                                本期同意支付工程款为：（大写）<input type="text" class="input-xt input-deptname"  name="supervision_amount_words"/>，（小写）<input type="text" class="input-xt input-name"  name="supervision_amount"/>请代建单位审批。
                                            </p>
                                            <div class="signature">
                                                <p style="margin-right:  120px">监理单位（章）：</p>
                                                <p>专业监理工程师(签字)<input type="text" class="input-xt input-name"  name=""/></p>
                                                <p>总监理工程师：<input type="text" class="input-xt input-name"  name=""/></p>
                                                <p>日期：<input type="text" class="input-xt input-name"  name=""/></p>
                                            </div>
                                            
                                        </td>
                                    </tr>
                                    </if>
                                    <if condition="($audit[5] OR $isAudit eq '2') AND $result['audit_level'] egt 5">
                                    <tr>
                                        <td colspan="4">
                                            代建单位审核意见:
                                            <p class="indent20"> 
                                                本期同意支付工程款为：（大写）<input type="text" class="input-xt input-deptname"  name="agent_construction_amount_words"/>，（小写）<input type="text" class="input-xt input-name"  name="agent_construction_amount"/>请建设单位审批。
                                            </p>
                                            <div class="signature">
                                                <p style="margin-right:  120px">代建单位（章）：</p>
                                                <p>代建负责人(签章)<input type="text" class="input-xt input-name"  name=""/></p>
                                                <p>日期：<input type="text" class="input-xt input-name"  name=""/></p>
                                            </div>
                                            
                                        </td>
                                    </tr>
                                    </if>
                                    <if condition="($audit[7] OR $isAudit eq '2') AND $result['audit_level'] egt 7">
                                    <tr>
                                        <td colspan="4">
                                            审批意见:
                                            <p class="indent20"> 
                                                本期同意支付工程款为：（大写）<input type="text" class="input-xt input-deptname"  name="construction_amount_words"/>，（小写）<input type="text" class="input-xt input-name"  name="construction_amount"/>。
                                            </p>
                                            <div>
                                                <p style="margin-right:  250px; text-align: right;">建设单位（盖章）：</p>
                                                <p> 
                                                    <div style="width: 50%;display: inline; margin-left: 20px">经办人：</div>
                                                    <div style="width: 50%;display: inline;float: right;margin-right: 120px;text-align: right;">建设单位代表（签字）<input type="text" class="input-xt input-name"  /></span>
                                                </p>
                                                <p style="text-align: right;margin-right: 0px;">日期：<input type="text" class="input-xt input-name"  name=""/></p>
                                            </div>  
                                        </td>
                                    </tr>
                                    </if>
                                    <if condition="$isAudit eq '2'">
                                        <tr>
                                            <td colspan="4">
                                                <label>审查意见：
                                                    <label style="width:50px;"><input type="radio" name="audit_status" value="1" checked />&nbsp;同意</label>
                                                    <label style="width:50px;"><input type="radio" name="audit_status" value="2" />&nbsp;驳回</label>
                                                </label>
                                                <textarea style="height:50px; width:100%" name="audit_reason" >{$audit.audit_reason}</textarea>
                                            </td>
                                        </tr>
                                    </if>
                                </table>
                                <if condition="$result['audit_level'] eq 1">
                                    <input type="hidden" name="audit_status" value="1" />
                                    <input type="hidden" name="audit_reason" value="变更保存" />
                                </if>
                                <div class="form-actions">
                                    <if condition="$isAudit eq '2'">
                                        <a class="btn btn-primary clickBtn" href="javascript:void(0);">{:L('SAVE')}</a>
                                    </if>
                                    <if condition="$result['audit_status'] eq 3">
                                        <a class="btn btn-warning" href="javascript:$.print('#access');">打印</a>
                                    </if>
                                    <a class="btn btn-default" href="{:U('ServiceReview/index')}">{:L('BACK')}</a>
                                </div>
                            </form>                   
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
    <script type="text/javascript">
        // 点击保存按钮
        $(".clickBtn").click(function(){
            $(".tips_error").remove();
            var audit_status = $("input[name='audit_status']:checked").val();
            var audit_reason = $("textarea[name='audit_reason']").val();
            if(audit_status == '2' && audit_reason == ""){
                $(".form-actions").append("<span class=\"tips_error\">驳回意见不允许为空！</span>");
                $("textarea[name='audit_reason']").focus()
                return false;
            }
            
            // 表单提交
            $("form").submit();
        });
    </script>
</body>
</html>